package com.eorchis.module.trainingquestionnaire.domain;

import java.math.BigInteger;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.codehaus.jackson.map.annotate.JsonSerialize;

import com.eorchis.core.springext.mvc.propertyeditor.CustomDateSerializer;
import com.eorchis.module.basedata.domain.BaseData;
import com.eorchis.module.department.domain.Department;
import com.eorchis.module.user.domain.User;
import com.eorchis.utils.utils.PropertyUtil;

public class QuestionnaireQueryBean {
	
	private String questionnaireId;//ID
	private String questionnaireName;//名称
	private BaseData questionnaireType;//类型
	private Integer surveyObjectType;//类型
	private Date beginDate;//日期
	private Date endDate;//日期
	private User user;//创建人id
	private Department department;//创建部门id
	private Integer surveyType;//类型
	private String questionnaireExplain;//edu说明
	private Integer publishState;//状态
	private Integer activeState;//活动状态
	private Date createDate;//创建日期
	
	private String assessStartDay;//结束时间前几天
	private String assessEndDay;//结束时间后几天
	
	private String assessCourseStartDay;//课程评估开始时间
	private String assessCourseEndDay;//课程评估结束时间
	
	private Integer assessmentState;//课程评估状态	1：未开始 2：正在评估 3：已评估 4：已过期
	private Integer testCondition;//用户是否已考试 : 1没有 ，2考过
	private String courseName;//课程名称
	private String courseId;//课程id
	private String speaker;//主讲教师
	private String ministrieName;//培训机构
	private String sponsorName;//主办单位
	public Integer getTestCondition() {
		return testCondition;
	}
	public void setTestCondition(BigInteger testCondition) {
		this.testCondition = testCondition.intValue();
	}
	public String getAssessStartDay() {
		return assessStartDay;
	}
	public void setAssessStartDay(Date assessStartDay) {
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
		if(PropertyUtil.objectNotEmpty(assessStartDay)){
			this.assessStartDay = simpleDateFormat.format(assessStartDay);
		}
		else{
			this.assessStartDay =null;
		}
	}
	public String getAssessEndDay() {
		return assessEndDay;
	}
	public void setAssessEndDay(Date assessEndDay) {
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
		if(PropertyUtil.objectNotEmpty(assessEndDay)){
			this.assessEndDay = simpleDateFormat.format(assessEndDay);
		}
		else{
			this.assessEndDay =null;
		}
	}
	public String getQuestionnaireId() {
		return questionnaireId;
	}
	public void setQuestionnaireId(String questionnaireId) {
		this.questionnaireId = questionnaireId;
	}
	public String getQuestionnaireName() {
		return questionnaireName;
	}
	public void setQuestionnaireName(String questionnaireName) {
		this.questionnaireName = questionnaireName;
	}
	public BaseData getQuestionnaireType() {
		return questionnaireType;
	}
	public void setQuestionnaireType(BaseData questionnaireType) {
		this.questionnaireType = questionnaireType;
	}
	public Integer getSurveyObjectType() {
		return surveyObjectType;
	}
	public void setSurveyObjectType(Integer surveyObjectType) {
		this.surveyObjectType = surveyObjectType;
	}
	public Date getBeginDate() {
		return beginDate;
	}
	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public Department getDepartment() {
		return department;
	}
	public void setDepartment(Department department) {
		this.department = department;
	}
	public Integer getSurveyType() {
		return surveyType;
	}
	public void setSurveyType(Integer surveyType) {
		this.surveyType = surveyType;
	}
	public String getQuestionnaireExplain() {
		return questionnaireExplain;
	}
	public void setQuestionnaireExplain(String questionnaireExplain) {
		this.questionnaireExplain = questionnaireExplain;
	}
	public Integer getPublishState() {
		return publishState;
	}
	public void setPublishState(Integer publishState) {
		this.publishState = publishState;
	}
	public Integer getActiveState() {
		return activeState;
	}
	public void setActiveState(Integer activeState) {
		this.activeState = activeState;
	}
	@JsonSerialize(using = CustomDateSerializer.class)
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public String getAssessCourseEndDay() {
		return assessCourseEndDay;
	}
	public void setAssessCourseEndDay(Date assessCourseEndDay) {
		if(PropertyUtil.objectNotEmpty(assessCourseEndDay)){
			this.assessCourseEndDay =new SimpleDateFormat("yyyy-MM-dd").format(assessCourseEndDay);
		}
	}
	public String getAssessCourseStartDay() {
		return assessCourseStartDay;
	}
	public void setAssessCourseStartDay(Date assessCourseStartDay) {
		if(PropertyUtil.objectNotEmpty(assessCourseStartDay)){
			this.assessCourseStartDay =new SimpleDateFormat("yyyy-MM-dd").format(assessCourseStartDay);
		}
	}
	public Integer getAssessmentState() {
		return assessmentState;
	}
	public void setAssessmentState(Integer assessmentState) {
		this.assessmentState = assessmentState;
	}
	public String getCourseName() {
		return courseName;
	}
	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}
	public String getCourseId() {
		return courseId;
	}
	public void setCourseId(String courseId) {
		this.courseId = courseId;
	}
	public String getSpeaker() {
		return speaker;
	}
	public void setSpeaker(String speaker) {
		this.speaker = speaker;
	}
	public String getMinistrieName() {
		return ministrieName;
	}
	public void setMinistrieName(String ministrieName) {
		this.ministrieName = ministrieName;
	}
	public String getSponsorName() {
		return sponsorName;
	}
	public void setSponsorName(String sponsorName) {
		this.sponsorName = sponsorName;
	}
}